Skip to content

runner: --describe prints a core's options and input labels, no ROM needed - #1

Merged
TechnicallyComputers merged 2 commits into
mainfrom
feat/describe
Sep 27, 2026
Merged

TechnicallyComputers merged 2 commits into
mainfrom
feat/describe

Conversation

@TechnicallyComputers

Copy link
Copy Markdown
Member

What

retro-core-runner --describe --core <lib> [--package <shim>] prints what a core declares — its options and input descriptors — without a ROM and without running a session. --version gains describe 1 so a host can check for support first, and runner_probe exposes it as RunnerVersion::describe.

This is what retro-hub's new settings page is built from (Retro-Launcher feat/direct-home): labels, choices and button names come from the core, not from a list compiled into the hub.

Behaviour

  • The core is loaded and its .rcore.toml checked exactly as for a run; a mismatch still exits 2.
  • options() and input_descriptors() are read, and nothing else: no init, load or deinit, and --out is not created. rcore.h declares both "read before load".
  • --package is validated as usual: refused on a core without game_package, and the file must be readable.
  • Failure: the message goes to stderr, stdout stays empty, and the exit code is 2.

Format (docs/CORE_RUNNER.md)

One record per line, TAB-separated, with \, TAB, LF and CR escaped:

describe	1
core	<id>	<version>	<platforms>
option	<key>	<enum|bool|int|string>	<restart,netplay,developer|->	<has_default>	<default>	<min>	<max>	<label>	<description>
value	<key>	<enum value>
input	<button bit>	<axis+1>	<axis_direction>	<label>

Tests

  • ctest 16/16: the 11 existing tests plus 5 new runner_describe_* cases (plain, package, package_none, unwanted, no_core). They compare stdout byte for byte, and the fake cores now declare fields carrying TAB, LF, CR and backslash.
  • To confirm the tests can fail, I broke the expected output (wrong labels, a wrong escape); they failed.
  • Real n64lle generic core 0.374.0: exit 0, 76 options, 16 values and 16 inputs, all with the right field counts.

Open

The ABI never says how an RCORE_OPT_BOOL value is spelled. --describe prints the core's default as given; the hub only draws a checkbox when that default shows the spelling.

🤖 Generated with Claude Code

…eeded

`retro-core-runner --describe --core <lib> [--package <shim>]` loads the core
and checks its .rcore.toml exactly as a run does, then prints what it declares
-- options (type, flags, default, range, label, description, enum values) and
input descriptors -- as TAB-separated records, one per line, with \ TAB LF CR
escaped. It never calls init, load or deinit, so a frontend can build a
settings page from the core's own declarations without a ROM or a session.

`--version` gains `describe 1`, and runner_probe reads it into
RunnerVersion::describe (0 for older runners), so a host can tell support
before asking.

Tests: five runner_describe_* cases compare stdout byte for byte (plain,
package, package_none, unwanted, no_core); the fake cores now declare options
and inputs whose fields carry a TAB, LF, CR and backslash. Format and checks
documented in docs/CORE_RUNNER.md, the --version key in docs/RELEASES.md.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… 1.1) and #2 (build-local)

runner_main.cpp: keep main's pkg_sha (declared outside the package block,
for the state keeper) and --describe's exemption from the package
requirement. build-local.sh --test: 18/18; --describe on n64lle's generic
core with the Pokemon Stadium package prints 76 options and 16 inputs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@TechnicallyComputers
TechnicallyComputers merged commit ff8a8c1 into main Sep 27, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant